/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.type;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author haolw
 * @time 2018/01/09
 */
public enum OrderSceneType {
	ON_LINE(1, "线上小程序商城"), 
	OFF_LINE(2, "用户主动扫主商户的聚合码"), 
	MERCHANT_SCAN(3, "主商户主动扫用户的支付码"),
	DEVELOPER_UNIFIED(4,"开发者统一下单，用户主动扫开发者的码跳转支付"),
	USER_SCAN_DYNAMIC(5,"用户主动扫分店绑定的聚合码"),
	USER_SCAN_BIND_STATIC(6,"用户主动扫分店绑定的静态聚合码");
	private Integer type;
	private String name;

	OrderSceneType(Integer type, String name) {
		this.type = type;
		this.name = name;
	}
	
	public static List<Integer> getMasterOffType(){
		List<Integer> types = new ArrayList<Integer>(8);
		types.add(2);
		types.add(3);
		types.add(5);
		types.add(6);
		return types;
	}
	
	public static String getNameByType(Integer type) {
		for (OrderSceneType orderSceneType : OrderSceneType.values()) {
			if (orderSceneType.getType().equals(type)) {
				return orderSceneType.getName();
			}
		}
		return "";
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}